import request from '../../../utils/request'

// 获取员工表格数据
// export const GetUserData = (currentPage,pageSize) => {
//     return request({
//         url: `/employee/listAllEmployee/${currentPage}/${pageSize}`,
//         method: 'get',
//     })
// }


//查询所有公司
export const GetAllCompany = () => {
    return request({
        url: '/syscompany/listAllSysCompany',
        method: 'get',
    })
}

//查询用户,(可查询所有或部分)
export const GetUserData = (currentPage,pageSize,search) => {
    return request({
        url: `/employee/listEmployeeByCondition/${currentPage}/${pageSize}`,
        method: 'post',
        data:search
    })
}



//创建用户
export const CreatUser = (data) => {
    return request({
        url: '/employee/employeeAdd',
        method: 'post',
        data:data
    })
}

//编辑用户
export const EditUser = (data) => {
    return request({
        url: '/employee/employeeUpdate',
        method: 'put',
        data:data
    })
}


//删除用户
export const DeleteUser = (id) => {
    return request({
        url: `/employee/employeeDelete/${id}`,
        method: 'delete',
        
    })
}

//注销用户
export const LogoutUser = (employeeId) => {
    return request({
        url: `/sysuser/logOut/${employeeId}`,
        method: 'delete',
        
    })
}



//注册角色列表获取接口
export const GetUserList = () => {
    return request({
        url: '/sysrole/listAllSysRoleName',
        method: 'get',
        
    })
}



//注册用户
export const RegisterUser = (employeeId,data) => {
    return request({
        url: `/sysuser/register/${employeeId}`,
        method: 'post',
        data:data
        
    })
}
